Integrand size = 19, antiderivative size = 90 \[ \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {a b \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2} d}-\frac {a \cos (c+d x)}{\left (a^2+b^2\right ) d}+\frac {b \sin (c+d x)}{\left (a^2+b^2\right ) d} \]
a*b*arctanh((b*cos(d*x+c)-a*sin(d*x+c))/(a^2+b^2)^(1/2))/(a^2+b^2)^(3/2)/d -a*cos(d*x+c)/(a^2+b^2)/d+b*sin(d*x+c)/(a^2+b^2)/d
Time = 0.46 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.88 \[ \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {-2 a b \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )+\sqrt {a^2+b^2} (-a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right )^{3/2} d} \]
(-2*a*b*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]] + Sqrt[a^2 + b^ 2]*(-(a*Cos[c + d*x]) + b*Sin[c + d*x]))/((a^2 + b^2)^(3/2)*d)
Time = 0.52 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.474, Rules used = {3042, 4001, 3042, 3588, 3042, 3117, 3118, 3553, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (c+d x)}{a+b \tan (c+d x)}dx\) |
\(\Big \downarrow \) 4001 |
\(\displaystyle \int \frac {\sin (c+d x) \cos (c+d x)}{a \cos (c+d x)+b \sin (c+d x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (c+d x) \cos (c+d x)}{a \cos (c+d x)+b \sin (c+d x)}dx\) |
\(\Big \downarrow \) 3588 |
\(\displaystyle \frac {a \int \sin (c+d x)dx}{a^2+b^2}+\frac {b \int \cos (c+d x)dx}{a^2+b^2}-\frac {a b \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)}dx}{a^2+b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \int \sin (c+d x)dx}{a^2+b^2}+\frac {b \int \sin \left (c+d x+\frac {\pi }{2}\right )dx}{a^2+b^2}-\frac {a b \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)}dx}{a^2+b^2}\) |
\(\Big \downarrow \) 3117 |
\(\displaystyle \frac {a \int \sin (c+d x)dx}{a^2+b^2}-\frac {a b \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)}dx}{a^2+b^2}+\frac {b \sin (c+d x)}{d \left (a^2+b^2\right )}\) |
\(\Big \downarrow \) 3118 |
\(\displaystyle -\frac {a b \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)}dx}{a^2+b^2}+\frac {b \sin (c+d x)}{d \left (a^2+b^2\right )}-\frac {a \cos (c+d x)}{d \left (a^2+b^2\right )}\) |
\(\Big \downarrow \) 3553 |
\(\displaystyle \frac {a b \int \frac {1}{a^2+b^2-(b \cos (c+d x)-a \sin (c+d x))^2}d(b \cos (c+d x)-a \sin (c+d x))}{d \left (a^2+b^2\right )}+\frac {b \sin (c+d x)}{d \left (a^2+b^2\right )}-\frac {a \cos (c+d x)}{d \left (a^2+b^2\right )}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {a b \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{d \left (a^2+b^2\right )^{3/2}}+\frac {b \sin (c+d x)}{d \left (a^2+b^2\right )}-\frac {a \cos (c+d x)}{d \left (a^2+b^2\right )}\) |
(a*b*ArcTanh[(b*Cos[c + d*x] - a*Sin[c + d*x])/Sqrt[a^2 + b^2]])/((a^2 + b ^2)^(3/2)*d) - (a*Cos[c + d*x])/((a^2 + b^2)*d) + (b*Sin[c + d*x])/((a^2 + b^2)*d)
3.1.55.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]
Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x _Symbol] :> Simp[-d^(-1) Subst[Int[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]
Int[(cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.))/(cos[(c_. ) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp[b /(a^2 + b^2) Int[Cos[c + d*x]^m*Sin[c + d*x]^(n - 1), x], x] + (Simp[a/(a ^2 + b^2) Int[Cos[c + d*x]^(m - 1)*Sin[c + d*x]^n, x], x] - Simp[a*(b/(a^ 2 + b^2)) Int[Cos[c + d*x]^(m - 1)*(Sin[c + d*x]^(n - 1)/(a*Cos[c + d*x] + b*Sin[c + d*x])), x], x]) /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0] && IGtQ[m, 0] && IGtQ[n, 0]
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n _.), x_Symbol] :> Int[Sin[e + f*x]^m*((a*Cos[e + f*x] + b*Sin[e + f*x])^n/C os[e + f*x]^n), x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && ILtQ [n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))
Time = 0.70 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.12
method | result | size |
derivativedivides | \(\frac {\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a}{\left (a^{2}+b^{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {4 a b \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (2 a^{2}+2 b^{2}\right ) \sqrt {a^{2}+b^{2}}}}{d}\) | \(101\) |
default | \(\frac {\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a}{\left (a^{2}+b^{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {4 a b \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (2 a^{2}+2 b^{2}\right ) \sqrt {a^{2}+b^{2}}}}{d}\) | \(101\) |
risch | \(-\frac {{\mathrm e}^{i \left (d x +c \right )}}{2 \left (-i b +a \right ) d}-\frac {{\mathrm e}^{-i \left (d x +c \right )}}{2 \left (i b +a \right ) d}+\frac {i b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, \left (a^{2}+b^{2}\right ) d}-\frac {i b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, \left (a^{2}+b^{2}\right ) d}\) | \(169\) |
1/d*(2/(a^2+b^2)*(b*tan(1/2*d*x+1/2*c)-a)/(1+tan(1/2*d*x+1/2*c)^2)-4*a*b/( 2*a^2+2*b^2)/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2 +b^2)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 185 vs. \(2 (86) = 172\).
Time = 0.28 (sec) , antiderivative size = 185, normalized size of antiderivative = 2.06 \[ \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\sqrt {a^{2} + b^{2}} a b \log \left (\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 2 \, {\left (a^{3} + a b^{2}\right )} \cos \left (d x + c\right ) + 2 \, {\left (a^{2} b + b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d} \]
1/2*(sqrt(a^2 + b^2)*a*b*log((2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2 )*cos(d*x + c)^2 - 2*a^2 - b^2 - 2*sqrt(a^2 + b^2)*(b*cos(d*x + c) - a*sin (d*x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)) - 2*(a^3 + a*b^2)*cos(d*x + c) + 2*(a^2*b + b^3)*sin(d*x + c))/((a ^4 + 2*a^2*b^2 + b^4)*d)
\[ \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx=\int \frac {\sin {\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \]
Time = 0.48 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.57 \[ \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {a b \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (a - \frac {b \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}}{a^{2} + b^{2} + \frac {{\left (a^{2} + b^{2}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \]
(a*b*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a* sin(d*x + c)/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) - 2* (a - b*sin(d*x + c)/(cos(d*x + c) + 1))/(a^2 + b^2 + (a^2 + b^2)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2))/d
Time = 0.43 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.31 \[ \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {a b \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )}}{{\left (a^{2} + b^{2}\right )} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}}}{d} \]
(a*b*log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*t an(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) + 2*(b*t an(1/2*d*x + 1/2*c) - a)/((a^2 + b^2)*(tan(1/2*d*x + 1/2*c)^2 + 1)))/d
Time = 4.45 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.22 \[ \int \frac {\sin (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {2\,a\,b\,\mathrm {atanh}\left (\frac {a^2\,b+b^3-a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2+b^2\right )}{{\left (a^2+b^2\right )}^{3/2}}\right )}{d\,{\left (a^2+b^2\right )}^{3/2}}-\frac {\frac {2\,a}{a^2+b^2}-\frac {2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2+b^2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]